package com.tanhua.manager.jobs;

import cn.hutool.core.date.DateTime;
import com.tanhua.manager.service.AnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AnalysisJob {
//    秒  分  时  日  月 周  年  *  ？  m/n

    @Autowired
    private AnalysisService analysisService;

//    @Scheduled(cron = "0 0/30 * * * ?")
    @Scheduled(cron = "0/10 * * * * ?")
    public void analysis(){

//        String todayStr = DateTime.now().toString("yyyy-MM-dd");
        String todayStr = new org.joda.time.DateTime().toString("yyyy-MM-dd");

        analysisService.analysis(todayStr);

        System.out.println("执行了每日统计的任务.....");

    }


}
